package com.hua.designpattern.j2eepattern.dao;

public class User {

	private int userNo = 0;
	private String name;
	private boolean gender = true;

	public User(int userNo, String name) {
		super();
		this.userNo = userNo;
		this.name = name;
	}

	public Integer getUserNo() {
		return userNo;
	}

	public void setUserNo(int userNo) {
		this.userNo = userNo;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isGender() {
		return gender;
	}

	public void setGender(boolean gender) {
		this.gender = gender;
	}

	@Override
	public String toString() {
		return super.toString() + "[userNo: " + userNo + " name: " + name + " gender: " + gender + "]";
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof User) {
			return ((User) obj).getUserNo().equals(userNo);
		}
		return super.equals(obj);
	}

}
